#ifndef CHATHISTORY_H
#define CHATHISTORY_H

#include <QDateTime>
#include <QString>
#include <QVector>
#include <QFileInfo>
#include <QDir>

class ChatHistory
{
private:
    QStringList questionList;
    QStringList answerList;
    QDateTime dateTime;
public:
    ChatHistory();
    const static char* DATE_FORMAT;
    void record(const QString& question, const QString& answer, bool newDate = true);
    bool record(
        const QStringList& questionList,
        const QStringList& answerList,
        bool newDate = true
    );
    void find(const QString& keyword, QVector<int>& indexVector);
    int getRecordsNumber() const;
    bool read(int index, QString& question, QString& answer) const;
    void read(QStringList& questionList, QStringList& answerList) const;
    bool save(const QString& currentDirPath, QString& dateStr) const;
    bool load(const QString& historyPath);
    QString getDateStr() const;
    QDateTime getDateTime() const;
};

#endif // CHATHISTORY_H
